//
//  KLCurrencyGroup.m
//  KLCurrency
//
//  Created by apple on 2017/12/24.
//  Copyright © 2017年 bonc. All rights reserved.
//

#import "KLCurrencyGroup.h"

#import "KLCurrencyEntity.h"

@implementation KLCurrencyGroup

- (instancetype)initWithDictionary :(NSDictionary *)dict
{
    if (self = [super init]) {;
        self.group = dict[@"group"];
        NSArray *dictArray = dict[@"currencies"];
        //将字典转换为模型
        NSMutableArray *models = [NSMutableArray arrayWithCapacity:dictArray.count];
        for (NSDictionary *dict in dictArray) {
            KLCurrencyEntity *car = [[KLCurrencyEntity alloc] initWithDictionary:dict];
            [models addObject:car];
        }
        self.currencies = models;
    }
    return self;
}

@end
